﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/plugins/layui/css/layui.css"  media="all">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
  <style>
    .layui-colla-title
    {
       padding: 0 15px 0 15px;
    }
    .layui-colla-item{
      padding-left: 15px;
    }
    dl{
      margin:0px;padding:0px;
    }
    dt{
      border-bottom:1px solid #FFF;
    }
    .cdd{-webkit-margin-start: 20px;}
  </style>
</head>
<body>
<form class="layui-form" lay-filter="kit-module-form" id="kit-module-form">
<div class="layui-colla-content layui-show">
  <h2 class="layui-colla-title">超级管理员</h2>
    <div class="layui-colla-item">
      <input type="checkbox" lay-filter="all-selector" title="全选" lay-skin="primary">
      <div  class="kit-tree">
      @Html.Raw(@ViewBag.str)
      </div>
</div>
</div>
</form>
 
          
<script src="/plugins/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
layui.use(['element', 'layer','form'], function(){
  var element = layui.element,
  $ = layui.jquery,
  form = layui.form,
  layer = layui.layer;
  
//监听全选点击事件
  form.on('checkbox(all-selector)', function (data) {
      var elem = data.elem,
          othis = data.othis,
          checked = elem.checked;
      othis.siblings('.kit-tree').find('input[type="checkbox"]').each(function () {
          this.checked = checked;
      });
      form.render('checkbox', 'kit-module-form');
      $('#kit-module-form').find('div[lay-skin="primary"]').on('click', function (e) {
          //阻止事件冒泡
          layui.stope(e);
      });
  });

});
</script>

</body>
</html>